package com.gcb.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gcb.domain.bo.ShipBIBO;
import com.gcb.domain.dto.ShipAppQueryPageDTO;
import com.gcb.domain.dto.ShipQueryDTO;
import com.gcb.domain.entity.Ship;
import com.gcb.domain.vo.*;
import com.gcb.domain.entity.ShipTrajectory;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ShipMapper extends BaseMapper<Ship> {

    /**
     * 查询所有船舶信息
     *
     * @return
     */
    List<Ship> getAllList();

    List<ShipVO> pageList(ShipQueryDTO dto);

    void updateBatchCompany(@Param("idList") Long[] idList,
                            @Param("companyId") Long companyId);

    ShipVO detail(String id);

    List<ShipVO> selectAppList(ShipAppQueryPageDTO dto);

    ShipVO selectAppByMmsi(String mmsiCode);

    Ship selectByMmsiCode(String mmsiCode);

    List<ShipVO> getUserShipList(@Param("shipName") String shipName, @Param("shipType") Integer shipType, @Param("companyId") String companyId);

    void insertBatchTrajectory(@Param("list") List<ShipTrajectory> allList);

    List<ShipTrajectoryVO> selectTrajectory(@Param("mmsiCode") String mmsiCode,
                                            @Param("startTime") String startTime,
                                            @Param("endTime") String endTime);

    String existNameByCompanyId(@Param("shipName") String shipName,
                                @Param("companyId") Long companyId,
                                @Param("id") Long id);

    List<ShipBIBO> selectBIList(String city);

}
